<?php
$page = "details";
include 'head.php';

if(!isset($_GET['d']) && !isset($_POST['day']) && !isset($_POST['month']) && !isset($_POST['year']))
{
  $day = lastday();
}
else if(isset($_GET['d'])){$day = $_GET['d'];}
else { $day = $_POST['year'].$_POST['month'].$_POST['day'];}

?>
<table border="0"><tr><td width="420"><h1><?php echo $wtage[date('w',mktime(0,0,0,substr($day,-4,2),substr($day,-2),substr($day,0,4)))].", ".substr($day,-2).".".substr($day,-4,2).".".substr($day,0,4); ?></h1></td>
<?php 
if($day >= firstday() && $day <= lastday())
{?>
<td width="420" align="right"> &Oslash; <?php echo integ_mblutzucker($day);?> mg/dl</td></tr></table>
<img src="graph.php?d=<?php echo $day; ?>&<?php echo SID?>">
<br><br>
<?php
}
else
{
  echo "</tr></table>";
  echo "Keine Daten vorhanden!<br><br>";
}
?>
<a href="details.php?d=<?php echo date('Ymd',mktime(0,0,0,substr($day,-4,2),substr($day,-2)-1,substr($day,0,4))); ?>&<?php echo SID?>"><img src="images/backward.jpg" border="0"></a>&nbsp;&nbsp;&nbsp; 
<a href="details.php?d=<?php echo date('Ymd',mktime(0,0,0,substr($day,-4,2),substr($day,-2)+1,substr($day,0,4))); ?>&<?php echo SID?>"><img src="images/forward.jpg" border="0"></a>  <br />
<?php

///Datumsauswahl
echo "<br><br>";
jumptodate($day);

include 'foot.php';
?>
